package com.abdulaziz.ms.ocv.gef.editor.factory;

import org.eclipse.gef.requests.CreationFactory;

import com.abdulaziz.ms.OCV.OCVFactory;
import com.abdulaziz.ms.OCV.UMLClass;
import com.abdulaziz.ms.OCV.UMLOperation;
import com.abdulaziz.ms.OCV.UMLVariable;

public class UMLClassFactory implements CreationFactory {

	@Override
	public Object getNewObject() {
		
		UMLClass umlClass = OCVFactory.eINSTANCE.createUMLClass();
		//--
		UMLVariable var = OCVFactory.eINSTANCE.createUMLVariable();
		UMLOperation op = OCVFactory.eINSTANCE.createUMLOperation();
		UMLVariable var2 = OCVFactory.eINSTANCE.createUMLVariable();
		
		var2.setVariableName("Var2");
		var2.setVariableType("Double");
		
		op.getOperationParameters().add(var2);
		var.setVariableName("Var 1");
		var.setVariableType("Int");
	op.setOperationName("operation1");
		umlClass.getClassOperations().add(op);
		umlClass.getClassAttributes().add(var);
		//
		return umlClass;
	}

	@Override
	public Object getObjectType() {
		return UMLClass.class;
	}

}
